using System;
using CommonMvc.Models.CommonModels;
using CommonMvc.Models.Sys;
using Microsoft.EntityFrameworkCore;

namespace CommonMvc.Models.Concreate
{
    
    public class DataContext:DbContext
    {
        public DataContext(DbContextOptions<DataContext> options):base(options){
            
        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
           
            
           

        }



        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            Person.OnModelCreating(modelBuilder);
            PersonRole.OnModelCreating(modelBuilder);
            Role.OnModelCreating(modelBuilder);
            RolePermission.OnModelCreating(modelBuilder);
            Menu.OnModelCreating(modelBuilder);
        }
        public virtual DbSet<Person> Persons{get;set;}
        public virtual DbSet<PersonRole> PersonRoles { get; set; }
        public virtual DbSet<Role> Roles { get; set; }
        public virtual DbSet<RolePermission> RolePermissions { get; set; }
        public virtual DbSet<Menu> Menus { get; set; }
    }




}